/** adopted from the following codes. WYU 122507
 * 
 * Copyright(c) 2006-2008, FeyaSoft Inc.
 * ====================================================================
 * Licence
 * ====================================================================
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
 * KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
 * WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE
 * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */
if (typeof uspiralweb == "undefined") {
    /**
     * The uspiralweb global package object.  If uspiralweb is already defined, the
     * existing feyaSoft object will not be overwritten so that defined
     * packages are preserved.
     * @class feyaSoft
     * @static
     */
    var uspiralweb = {};
}

var package = function() {
    var a=arguments, o=null, i, j, d;
    for (i=0; i < a.length; i=i+1) {
        d=a[i].split(".");
        o=uspiralweb;

        // feyaSoft is implied, so it is ignored if it is included
        for (j=(d[0] == "uspiralweb") ? 1 : 0; j<d.length; j=j+1) {
            o[d[j]]=o[d[j]] || {};
            o=o[d[j]];
        }
    }
    return o;
};

function newTextField(lable, pct_width, name, nullable, readonly)
{
  name     |= lable;
  nullable |= false;
  readonly |= false;
  return new Ext.form.TextField({fieldLabel: lable,allowBlank: nullable,name: name,anchor: pct_width,readOnly: readonly});
}
function newPasswdField(lable, pct_width, name, nullable, readonly)
{
  name     |= lable;
  nullable |= false;
  readonly |= false;
  return new Ext.form.TextField({fieldLabel: lable,allowBlank: nullable,name: name,anchor: pct_width,inputType: 'password',readOnly: readonly});
}
function newDateField(lable, pct_width, name, format, readonly)
{
  name     |= lable;
  format   |= 'M d, Y';
  readonly |= false;

  return new Ext.form.DateField({fieldLabel: lable,name: name,format:format,anchor: pct_width,readOnly: readonly});
}
function newTextArea(lable, pct_width, name)
{
  return new Ext.form.TextField({xtype: 'textarea',hideLabel: (!name),name: lable,anchor: pct_width});
}
